package com.sc.nft.admin.controller;

import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.exception.GlobalException;
import com.sc.nft.service.InformationArticleService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/article")
@Api(tags ="文章")
public class ArticleController {
    private final InformationArticleService informationArticleService;

    @ApiOperation(value = "文章爬虫", notes = "文章爬虫", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/articleCrawler", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result exchangeCdk() throws GlobalException {
        informationArticleService.articleCrawler();
        return Result.success();
    }
}
